#define _CRT_SECURE_NO_WARNINGS  1


#include <iostream>
using namespace std;

bool Isleapyear(int year)
{
    if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
    {
        return true;
    }
    return false;
}

int Getday(int year, int month, int day)

{
    int Day = day;
    int Month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (Isleapyear(year))
    {
        Month[1]++;
    }
    for (int i = 0; i < month - 1; i++)
    {
        Day += Month[i];
    }
    return Day;
}

int main()
{
    char s1[9];
    char s2[9];
    while (cin >> s1 >> s2)
    {
        int year1, year2, month1, month2, day1, day2;
        sscanf(s1, "%4d%2d%2d", &year1, &month1, &day1);
        sscanf(s2, "%4d%2d%2d", &year2, &month2, &day2);
        int max = year1;
        if (year1 < year2)
        {
            year1 = year2;
            year2 = max;
        }
        int num1 = abs(Getday(year1, month1, day1) - Getday(year2, month2, day2));
        int num2 = 0;
        while (year1 > year2)
        {
            if (Isleapyear(year2))
            {
                num2 += 366;
            }
            num2 += 365;
            year2++;
        }
        int num = num1 + num2 + 1;
        cout << num << endl;
    }
}